| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Static Public Member Functions | List of all members
nkWinUi::ContentLoader Class Referencefinal

Allows to export and import content through their declaration files. More...

## Static Public Member Functions
static nkExport::ExporterLoadResult | inputData (nkMemory::StringView filePath)
static nkExport::ExporterLoadResult | inputDataSources (nkMemory::StringView sources)
static bool | outputData (nkMemory::StringView content, nkMemory::StringView path)
static bool | saveObjectDeclaration (nkExport::Exportable *object, nkMemory::StringView pathFromData)
static Component * | loadComponentDeclaration (nkMemory::StringView pathFromData)
static Component * | processComponentSources (nkMemory::StringView sources)
static Component * | processComponentTree (nkExport::Node *tree)
static Layout * | loadLayoutDeclaration (nkMemory::StringView pathFromData)
static Layout * | processLayoutSources (nkMemory::StringView sources)
static Layout * | processLayoutTree (nkExport::Node *tree)
static Component * | loadInterfaceDeclaration (nkMemory::StringView pathFromData)
static Component * | processInterfaceSources (nkMemory::StringView sources)
static Component * | processInterfaceTree (nkExport::Node *tree)

## Detailed Description

Allows to export and import content through their declaration files.

## Member Function Documentation

## ◆ inputData()

static nkExport::ExporterLoadResult nkWinUi::ContentLoader::inputData | ( | nkMemory::StringView | filePath | ) |
| static

Inputs data from a file and returns associated tree, if parsing can occur. It will use Json parsing.

Parameters

  filePath | The file path, relative to working directory. See nkResources::ResourceManager for path naming convention.

Returns
  The result after loading designated file.

## ◆ inputDataSources()

static nkExport::ExporterLoadResult nkWinUi::ContentLoader::inputDataSources | ( | nkMemory::StringView | sources | ) |
| static

Inputs data from memory and returns associated tree, if parsing can occur. It will use Json parsing.

Parameters

  sources | The sources to parse.

Returns
  The result after loading designated memory chunk.

## ◆ outputData()

static bool nkWinUi::ContentLoader::outputData | ( | nkMemory::StringView | content,
|  | nkMemory::StringView | path
| ) |  |
| static

Writes data to a file.

Parameters

  content | The content to write.
  path | The path, relative to working directory, to output the file to. See nkResources::ResourceManager for path naming convention.

Returns
  If the data could succesfully be output (true) or not (false).

## ◆ saveObjectDeclaration()

static bool nkWinUi::ContentLoader::saveObjectDeclaration | ( | nkExport::Exportable * | object,
|  | nkMemory::StringView | pathFromData
| ) |  |
| static

Saves an exportable into a file.

Parameters

  object | The object to serialize and export.
  pathFromData | The path, relative to working directory, to output the file to. See nkResources::ResourceManager for path naming convention.

Returns
  If the data could succesfully be output (true) or not (false).

## ◆ loadComponentDeclaration()

static Component* nkWinUi::ContentLoader::loadComponentDeclaration | ( | nkMemory::StringView | pathFromData | ) |
| static

Loads a component declaration, from a file.

Parameters

  pathFromData | The file path, relative to working directory. See nkResources::ResourceManager for path naming convention.

Returns
  The parsed component if successful, nullptr else.

## ◆ processComponentSources()

static Component* nkWinUi::ContentLoader::processComponentSources | ( | nkMemory::StringView | sources | ) |
| static

Loads a component declaration, from memory.

Parameters

  sources | The memory chunk to interpret.

Returns
  The parsed component if successful, nullptr else.

## ◆ processComponentTree()

static Component* nkWinUi::ContentLoader::processComponentTree | ( | nkExport::Node * | tree | ) |
| static

Loads a component declaration, from an existing tree.

Parameters

  tree | The tree to interpret.

Returns
  The parsed component if successful, nullptr else.

## ◆ loadLayoutDeclaration()

static Layout* nkWinUi::ContentLoader::loadLayoutDeclaration | ( | nkMemory::StringView | pathFromData | ) |
| static

Loads a Layout declaration, from a file.

Parameters

  pathFromData | The file path, relative to working directory. See nkResources::ResourceManager for path naming convention.

Returns
  The parsed Layout if successful, nullptr else.

## ◆ processLayoutSources()

static Layout* nkWinUi::ContentLoader::processLayoutSources | ( | nkMemory::StringView | sources | ) |
| static

Loads a Layout declaration, from memory.

Parameters

  sources | The memory chunk to interpret.

Returns
  The parsed Layout if successful, nullptr else.

## ◆ processLayoutTree()

static Layout* nkWinUi::ContentLoader::processLayoutTree | ( | nkExport::Node * | tree | ) |
| static

Loads a Layout declaration, from an existing tree.

Parameters

  tree | The tree to interpret.

Returns
  The parsed Layout if successful, nullptr else.

## ◆ loadInterfaceDeclaration()

static Component* nkWinUi::ContentLoader::loadInterfaceDeclaration | ( | nkMemory::StringView | pathFromData | ) |
| static

Loads a interface (Component mixed with Layout) declaration, from a file.

Parameters

  pathFromData | The file path, relative to working directory. See nkResources::ResourceManager for path naming convention.

Returns
  The parsed root component of the interface if successful, nullptr else.

## ◆ processInterfaceSources()

static Component* nkWinUi::ContentLoader::processInterfaceSources | ( | nkMemory::StringView | sources | ) |
| static

Loads a interface (Component mixed with Layout) declaration, from memory.

Parameters

  sources | The memory chunk to interpret.

Returns
  The parsed root component of the interface if successful, nullptr else.

## ◆ processInterfaceTree()

static Component* nkWinUi::ContentLoader::processInterfaceTree | ( | nkExport::Node * | tree | ) |
| static

Loads an interface (Component mixed with Layout) declaration, from an existing tree.

Parameters

  tree | The tree to interpret.

Returns
  The parsed root component of the interface if successful, nullptr else.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsWinUi/Exporter/ContentLoader.h